package com.nkzy.controller;

import com.nkzy.domain.User;
import com.nkzy.mapper.UserMapper;
import com.nkzy.service.UserService;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;

/**
 * Create by 王建烨 on 2022/3/21 9:33
 **/

@RestController
@RequestMapping("/users")
public class UserController {
    @Resource
    private UserService userService;

    @RequestMapping("/test")
    public String test(){
        return "success";
    }

    @RequestMapping("/findAll")
    public List<User> findAll(){
        return userService.findAll();
    }

    @RequestMapping("/findById")
    public User findById(Integer id){
        return userService.findById(id);
    }
}
